import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      meta: {index: 0}, // meta对象的index用来定义当前路由的层级,由小到大,由低到高
      component: require('@/components/Home').default
    },
    {
      path: '/one',
      name: 'one',
      meta: {index: 1}, // meta对象的index用来定义当前路由的层级,由小到大,由低到高
      component: require('@/components/one/OneForm').default
    },
    {
      path: '/one/result',
      name: 'one-result',
      meta: {index: 2}, // meta对象的index用来定义当前路由的层级,由小到大,由低到高
      component: require('@/components/one/OneResult').default
    },
    {
      path: '/multi',
      name: 'multi',
      meta: {index: 1}, // meta对象的index用来定义当前路由的层级,由小到大,由低到高
      component: require('@/components/multi/MultiForm').default
    },
    {
      path: '/multi/result',
      name: 'multi-result',
      meta: {index: 2}, // meta对象的index用来定义当前路由的层级,由小到大,由低到高
      component: require('@/components/multi/MultiResult').default
    },
    {
      path: '*',
      redirect: '/'
    }
  ]
})
